package service.impl;

import lombok.extern.slf4j.Slf4j;
import rock.common.annotation.RpcService;
import service.IUserService;

@Slf4j
@RpcService(group = "example1", version = "version01")
public class UserServiceImpl implements IUserService {

    static {
        System.out.println("UserServiceImpl has been created.");
    }

    public String getUserById(long id) {
        System.out.println("request coming");
        log.info("UserServiceImpl receive id:[{}]", id);
        // get from cache or db
        // User user = new User(id, "user1", "read from db");
        String ans = "id" + id ;
        log.info("UserServiceImpl got user:[{}]", ans);
        return ans;
    }
}
